﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model_SSResourceManager;
using Presenter_SSResourceManager;

namespace WebView_SSResourceManager.UserPages
{
    public partial class MyQueuesView : System.Web.UI.Page, IViewMyQueues
    {
        public PresenterMyQueusView MyQueusViewPresenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            MyQueusViewPresenter = new PresenterMyQueusView(this);
            MyQueusViewPresenter.Refresh(GetUserId());
        }

        public void ShowQueues(IEnumerable<Queue> queues)
        {
            lstV_MyQueuesView.DataSource = queues;
            lstV_MyQueuesView.DataBind();
        }

        public Guid GetUserId()
        {
            return Guid.Parse(Server.HtmlEncode(Request.Cookies["UID"].Value));
        }
    }
}